﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class StringToHex
{
    public static void ToHex(string str)
    {
        foreach (char item in str)
        {
            Console.Write(String.Format(@"\x{0:X}",(int)item));
        }
        Console.WriteLine();
    }

    static void Main()
    {
        ToHex("Hi!");
    }
}
